Repository navigation
fix: wrap setup.sh escape hatch with 300s timeout to prevent indefinite build hang - #23
Merged
Merged
Conversation
…te build hang Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
Research ReviewVerified
Adjacent Stubs Detected
Orphaned Files Detected
Escape Hatch Coverage
Object Shape Verification
Contract diff
Impact Analysis
Risks Not Tested
Research Suggestions
No blocking issues found. Research is well-grounded: the PR's central claim (this repo has no loading-server mechanism, unlike php-runner) was independently verified against the actual source rather than assumed, line numbers match current Reviewed by PR Research Validator. This review checks whether code is based on verified sources rather than assumptions. |
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #22. Sibling of the already-fixed
Eyevinn/php-runner#8(PR Eyevinn/php-runner#9, verified — 300s timeout, same terminal-failure treatment for timeout and non-zero exit).scripts/docker-entrypoint.sh:261-264(verified against currentmainbefore implementing — line numbers matched exactly) ran the optionalsetup.shescape hatch with no timeout:If
setup.shnever exits, the entrypoint blocks forever: the container never finishes starting, with no terminal signal.Changes
scripts/docker-entrypoint.sh: wraps the invocation withtimeout 300s, captures the exit code, and treats both a timeout (exit 124) and any other non-zero exit as a terminal failure by exiting the whole script with that code.tests/test-entrypoint-setup-timeout.sh(new): static assertions that the timeout wrapper and both failure branches are present, plus sandboxed behavioral tests that a hangingsetup.shis actually killed within seconds (exit 124), a fast-failingsetup.shreports its real exit code, and a well-behavedsetup.shstill succeeds.Deviation from the linked php-runner fix (verified, not assumed)
The issue and its php-runner sibling both describe the terminal-failure pattern as "kill loading server / serve the failed error page." I verified this repo's actual
scripts/docker-entrypoint.sh(and the whole repo — a search for loading-server / healthz / buildStatus / LOADING_PID / supervisor references returns nothing relevant, and there is no loading-server or error-page file anywhere) and confirmed python-runner has no such HTTP-level build-status mechanism at all, unlike php-runner. This script runs underset -eat the top; every existing build-step failure (e.g. a failedpip installa few lines above) already terminates the run viaset -epropagating a non-zero exit — no HTTP handoff to "kill". So the fix here follows that existing pattern instead of inventing a loading-server mechanism that doesn't exist: both the timeout and non-zero-exit branches explicitlyexitwith the relevant code, which is functionally identical to what already happens for every other build-step failure in this file.Testing
bash -n scripts/docker-entrypoint.sh— syntax OKbash tests/test-entrypoint-setup-timeout.sh— 7/7 passedtest-entrypoint-credential-header-auth.sh— 13/13test-entrypoint-credential-scrub.sh— 6/6test-entrypoint-fragment-branch.sh— 8/8test-entrypoint-subpath.sh— 7/7package.json/src/, so the npm-based pre-commit checklist was skipped per repo layout; the shell checklist (bash -n, plus the test scripts above) was used instead.shellcheckwas not available in this environment.Lessons
The issue's acceptance criteria (copied from the php-runner sibling ticket) assumed this repo shares php-runner's "kill loading server / serve error page" terminal-failure mechanism — it doesn't. python-runner's entrypoint has no HTTP build-status server at all; it relies entirely on
set -epropagation for terminal failure, which was already correct behavior for every existing build-step failure (e.g. pip install). Verifying the actual file content (not just the line-number match, which happened to line up exactly with the linked PR) before implementing avoided inventing a mechanism that doesn't exist in this codebase.🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com